Skip to content

feat(tower): Record http.response.status_code on HTTP transactions#1253

Open
lcian wants to merge 5 commits into
masterfrom
feat/tower-http-response-status-code
Open

feat(tower): Record http.response.status_code on HTTP transactions#1253
lcian wants to merge 5 commits into
masterfrom
feat/tower-http-response-status-code

Conversation

@lcian

@lcian lcian commented Jul 21, 2026

Copy link
Copy Markdown
Member

When SentryHttpLayer starts a transaction for an incoming request, successful responses now also set the canonical http.response.status_code attribute on transaction data. The existing SpanStatus mapping is unchanged; this adds the numeric status so Sentry can surface HTTP response codes the same way other SDKs do.

Only the tower HTTP integration is affected, and only when transactions are enabled.

Context: I was trying to debug something and find traces with a particular status code.

SentryHttpLayer already mapped response statuses to SpanStatus, but did
not attach the numeric HTTP status as span/transaction data. Record the
canonical http.response.status_code attribute from sentry-conventions.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

This comment has been minimized.

@lcian

lcian commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

bugbot run
@sentry review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 951babc. Configure here.

lcian and others added 4 commits July 21, 2026 13:18
Only set the attribute when it is not already present, matching the
existing guard around transaction status.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Danger requires the PR number in Unreleased changelog entries.

Co-Authored-By: Claude <noreply@anthropic.com>
@lcian
lcian marked this pull request as ready for review July 21, 2026 11:29
@lcian
lcian requested a review from a team as a code owner July 21, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant